#encoding=utf8

import os
from numpy import *

def file_matrix(filepath):
	file = open(filepath)
	lines_arr = file.readlines()

	#初始化一个全是0的特征数据集
	zero_mat = zeros((len(lines_arr),3))
	label_mat = [] # 标签集

	i = 0
	for line in lines_arr:
		data = line.strip().split('\t')
		#取出数组前3位数
		zero_mat[i,:] = data[0:3]
		#取数组倒数第一位数
		label_mat.append(int(data[-1]))
		i = i+1

	return zero_mat,label_mat

if __name__ == '__main__':
	filepath = r'../new_txt/dataset.txt'
	file_matrix(filepath)